<!DOCTYPE HTML>
<html>
	<head>
		<meta http-equiv="Content-Type" content="html/html; charset=utf-8" />
		<title>CCTexture Class Reference</title>
		<meta id="xcode-display" name="xcode-display" content="render"/>
		<link rel="stylesheet" type="text/css" href="../css/styles.css" media="all" />
		<link rel="stylesheet" type="text/css" media="print" href="../css/stylesPrint.css" />
		<meta name="generator" content="appledoc 2.2 (build 963)" />
	</head>
	<body>
		<header id="top_header">
			<div id="library" class="hideInXcode">
				<h1><a id="libraryTitle" href="../index.html">Cocos2D </a></h1>
				<a id="developerHome" href="../index.html">3.2.0</a>
			</div>
			
			<div id="title" role="banner">
				<h1 class="hideInXcode">CCTexture Class Reference</h1>
			</div>
			<ul id="headerButtons" role="toolbar">
				<li id="toc_button">
					<button aria-label="Show Table of Contents" role="checkbox" class="open" id="table_of_contents"><span class="disclosure"></span>Table of Contents</button>
				</li>
				<li id="jumpto_button" role="navigation">
					<select id="jumpTo">
	<option value="top">Jump To&#133;</option>
	
	<option value="overview">Overview</option>
	
	
	
	
	<option value="tasks">Tasks</option>
	
	
	
	
	
	<option value="properties">Properties</option>
	
	<option value="//api/name/antialiased">&nbsp;&nbsp;&nbsp;&nbsp;antialiased</option>
	
	<option value="//api/name/contentScale">&nbsp;&nbsp;&nbsp;&nbsp;contentScale</option>
	
	<option value="//api/name/contentSizeInPixels">&nbsp;&nbsp;&nbsp;&nbsp;contentSizeInPixels</option>
	
	<option value="//api/name/pixelFormat">&nbsp;&nbsp;&nbsp;&nbsp;pixelFormat</option>
	
	<option value="//api/name/pixelHeight">&nbsp;&nbsp;&nbsp;&nbsp;pixelHeight</option>
	
	<option value="//api/name/pixelWidth">&nbsp;&nbsp;&nbsp;&nbsp;pixelWidth</option>
	
	<option value="//api/name/premultipliedAlpha">&nbsp;&nbsp;&nbsp;&nbsp;premultipliedAlpha</option>
	
	
	
	
	<option value="class_methods">Class Methods</option>
	
	<option value="//api/name/bitsPerPixelForFormat:">&nbsp;&nbsp;&nbsp;&nbsp;+ bitsPerPixelForFormat:</option>
	
	<option value="//api/name/defaultAlphaPixelFormat">&nbsp;&nbsp;&nbsp;&nbsp;+ defaultAlphaPixelFormat</option>
	
	<option value="//api/name/none">&nbsp;&nbsp;&nbsp;&nbsp;+ none</option>
	
	<option value="//api/name/setDefaultAlphaPixelFormat:">&nbsp;&nbsp;&nbsp;&nbsp;+ setDefaultAlphaPixelFormat:</option>
	
	<option value="//api/name/textureWithFile:">&nbsp;&nbsp;&nbsp;&nbsp;+ textureWithFile:</option>
	
	
	
	
	<option value="instance_methods">Instance Methods</option>
	
	<option value="//api/name/bitsPerPixelForFormat">&nbsp;&nbsp;&nbsp;&nbsp;- bitsPerPixelForFormat</option>
	
	<option value="//api/name/contentSize">&nbsp;&nbsp;&nbsp;&nbsp;- contentSize</option>
	
	<option value="//api/name/createSpriteFrame">&nbsp;&nbsp;&nbsp;&nbsp;- createSpriteFrame</option>
	
	<option value="//api/name/initWithCGImage:contentScale:">&nbsp;&nbsp;&nbsp;&nbsp;- initWithCGImage:contentScale:</option>
	
	<option value="//api/name/initWithData:pixelFormat:pixelsWide:pixelsHigh:contentSizeInPixels:contentScale:">&nbsp;&nbsp;&nbsp;&nbsp;- initWithData:pixelFormat:pixelsWide:pixelsHigh:contentSizeInPixels:contentScale:</option>
	
	<option value="//api/name/stringForFormat">&nbsp;&nbsp;&nbsp;&nbsp;- stringForFormat</option>
	
	
	
</select>
				</li>
			</ul>
		</header>
		<nav id="tocContainer" class="isShowingTOC">
			<ul id="toc" role="tree">
				
<li role="treeitem"><span class="nodisclosure"></span><span class="sectionName"><a href="#overview">Overview</a></span></li>




<li role="treeitem" id="task_treeitem"><span class="nodisclosure"></span><span class="sectionName"><a href="#tasks">Tasks</a></span><ul>
	
	<li><span class="nodisclosure"></span><span class="sectionName"><a href="#task_Initializing a CCTexture Object">Initializing a CCTexture Object</a></span></li>
	
	<li><span class="nodisclosure"></span><span class="sectionName"><a href="#task_Creating a CCTexture Object">Creating a CCTexture Object</a></span></li>
	
	<li><span class="nodisclosure"></span><span class="sectionName"><a href="#task_Accessing The Texture Attributes">Accessing The Texture Attributes</a></span></li>
	
	<li><span class="nodisclosure"></span><span class="sectionName"><a href="#task_Image Methods">Image Methods</a></span></li>
	
	<li><span class="nodisclosure"></span><span class="sectionName"><a href="#task_PixelFormat Methods">PixelFormat Methods</a></span></li>
	
</ul></li>





<li role="treeitem" class="children"><span class="disclosure"></span><span class="sectionName"><a href="#properties">Properties</a></span><ul>
	
	<li><span class="nodisclosure"></span><span class="sectionName"><a href="#//api/name/antialiased">antialiased</a></span></li>
	
	<li><span class="nodisclosure"></span><span class="sectionName"><a href="#//api/name/contentScale">contentScale</a></span></li>
	
	<li><span class="nodisclosure"></span><span class="sectionName"><a href="#//api/name/contentSizeInPixels">contentSizeInPixels</a></span></li>
	
	<li><span class="nodisclosure"></span><span class="sectionName"><a href="#//api/name/pixelFormat">pixelFormat</a></span></li>
	
	<li><span class="nodisclosure"></span><span class="sectionName"><a href="#//api/name/pixelHeight">pixelHeight</a></span></li>
	
	<li><span class="nodisclosure"></span><span class="sectionName"><a href="#//api/name/pixelWidth">pixelWidth</a></span></li>
	
	<li><span class="nodisclosure"></span><span class="sectionName"><a href="#//api/name/premultipliedAlpha">premultipliedAlpha</a></span></li>
	
</ul></li>



<li role="treeitem" class="children"><span class="disclosure"></span><span class="sectionName"><a href="#class_methods">Class Methods</a></span><ul>
	
	<li><span class="nodisclosure"></span><span class="sectionName"><a href="#//api/name/bitsPerPixelForFormat:">bitsPerPixelForFormat:</a></span></li>
	
	<li><span class="nodisclosure"></span><span class="sectionName"><a href="#//api/name/defaultAlphaPixelFormat">defaultAlphaPixelFormat</a></span></li>
	
	<li><span class="nodisclosure"></span><span class="sectionName"><a href="#//api/name/none">none</a></span></li>
	
	<li><span class="nodisclosure"></span><span class="sectionName"><a href="#//api/name/setDefaultAlphaPixelFormat:">setDefaultAlphaPixelFormat:</a></span></li>
	
	<li><span class="nodisclosure"></span><span class="sectionName"><a href="#//api/name/textureWithFile:">textureWithFile:</a></span></li>
	
</ul></li>



<li role="treeitem" class="children"><span class="disclosure"></span><span class="sectionName"><a href="#instance_methods">Instance Methods</a></span><ul>
	
	<li><span class="nodisclosure"></span><span class="sectionName"><a href="#//api/name/bitsPerPixelForFormat">bitsPerPixelForFormat</a></span></li>
	
	<li><span class="nodisclosure"></span><span class="sectionName"><a href="#//api/name/contentSize">contentSize</a></span></li>
	
	<li><span class="nodisclosure"></span><span class="sectionName"><a href="#//api/name/createSpriteFrame">createSpriteFrame</a></span></li>
	
	<li><span class="nodisclosure"></span><span class="sectionName"><a href="#//api/name/initWithCGImage:contentScale:">initWithCGImage:contentScale:</a></span></li>
	
	<li><span class="nodisclosure"></span><span class="sectionName"><a href="#//api/name/initWithData:pixelFormat:pixelsWide:pixelsHigh:contentSizeInPixels:contentScale:">initWithData:pixelFormat:pixelsWide:pixelsHigh:contentSizeInPixels:contentScale:</a></span></li>
	
	<li><span class="nodisclosure"></span><span class="sectionName"><a href="#//api/name/stringForFormat">stringForFormat</a></span></li>
	
</ul></li>


			</ul>
		</nav>
		<article>
			<div id="contents" class="isShowingTOC" role="main">
				<a title="CCTexture Class Reference" name="top"></a>
				<div class="main-navigation navigation-top">
					<ul>
	<li><a href="../index.html">Index</a></li>
	<li><a href="../hierarchy.html">Hierarchy</a></li>
</ul>
				</div>
				<div id="header">
					<div class="section-header">
						<h1 class="title title-header">CCTexture Class Reference</h1>
					</div>		
				</div>
				<div id="container">	
					
					<div class="section section-specification"><table cellspacing="0"><tbody>
						<tr>
	<td class="specification-title">Inherits from</td>
	<td class="specification-value">NSObject</td>
</tr><tr>
	<td class="specification-title">Declared in</td>
	<td class="specification-value">CCTexture.h</td>
</tr>
						</tbody></table></div>
					
                    
                    
					
					<div class="section section-overview">
						<a title="Overview" name="overview"></a>
						<h2 class="subtitle subtitle-overview">Overview</h2>
						<p>CCTexture2D class.
This class allows to easily create OpenGL 2D textures from images, text or raw data.
The created CCTexture2D object will always have power-of-two dimensions.
Depending on how you create the CCTexture2D object, the actual image area of the texture might be smaller than the texture dimensions
- i.e. &ldquo;contentSize&rdquo; != (pixelsWide, pixelsHigh) and (maxS, maxT) != (1.0, 1.0).
Be aware that the content of the generated textures will be upside-down!</p>

<p>Extensions to make it easy to create a CCTexture2D object from an image file.
Note that RGBA type textures will have their alpha premultiplied - use the blending mode (GL_ONE, GL_ONE_MINUS_SRC_ALPHA).</p>
					</div>
					
					
					
					
					
					<div class="section section-tasks">
						<a title="Tasks" name="tasks"></a>
						<h2 class="subtitle subtitle-tasks">Tasks</h2>
						
						
						<a title="Initializing a CCTexture Object" name="task_Initializing a CCTexture Object"></a>
						<h3 class="subsubtitle task-title">Initializing a CCTexture Object</h3>

						<ul class="task-list">
							<li>
	<span class="tooltip">
		<code><a href="#//api/name/initWithData:pixelFormat:pixelsWide:pixelsHigh:contentSizeInPixels:contentScale:">&ndash;&nbsp;initWithData:pixelFormat:pixelsWide:pixelsHigh:contentSizeInPixels:contentScale:</a></code>
	</span>
	
	
</li>
						</ul>
						
						
						<a title="Creating a CCTexture Object" name="task_Creating a CCTexture Object"></a>
						<h3 class="subsubtitle task-title">Creating a CCTexture Object</h3>

						<ul class="task-list">
							<li>
	<span class="tooltip">
		<code><a href="#//api/name/textureWithFile:">+&nbsp;textureWithFile:</a></code>
	</span>
	
	
</li><li>
	<span class="tooltip">
		<code><a href="#//api/name/none">+&nbsp;none</a></code>
	</span>
	
	
</li>
						</ul>
						
						
						<a title="Accessing The Texture Attributes" name="task_Accessing The Texture Attributes"></a>
						<h3 class="subsubtitle task-title">Accessing The Texture Attributes</h3>

						<ul class="task-list">
							<li>
	<span class="tooltip">
		<code><a href="#//api/name/pixelFormat">&nbsp;&nbsp;pixelFormat</a></code>
	</span>
	<span class="task-item-suffix">property</span>
	
</li><li>
	<span class="tooltip">
		<code><a href="#//api/name/pixelWidth">&nbsp;&nbsp;pixelWidth</a></code>
	</span>
	<span class="task-item-suffix">property</span>
	
</li><li>
	<span class="tooltip">
		<code><a href="#//api/name/pixelHeight">&nbsp;&nbsp;pixelHeight</a></code>
	</span>
	<span class="task-item-suffix">property</span>
	
</li><li>
	<span class="tooltip">
		<code><a href="#//api/name/contentSizeInPixels">&nbsp;&nbsp;contentSizeInPixels</a></code>
	</span>
	<span class="task-item-suffix">property</span>
	
</li><li>
	<span class="tooltip">
		<code><a href="#//api/name/premultipliedAlpha">&nbsp;&nbsp;premultipliedAlpha</a></code>
	</span>
	<span class="task-item-suffix">property</span>
	
</li><li>
	<span class="tooltip">
		<code><a href="#//api/name/antialiased">&nbsp;&nbsp;antialiased</a></code>
	</span>
	<span class="task-item-suffix">property</span>
	
</li><li>
	<span class="tooltip">
		<code><a href="#//api/name/contentScale">&nbsp;&nbsp;contentScale</a></code>
	</span>
	<span class="task-item-suffix">property</span>
	
</li><li>
	<span class="tooltip">
		<code><a href="#//api/name/contentSize">&ndash;&nbsp;contentSize</a></code>
	</span>
	
	
</li><li>
	<span class="tooltip">
		<code><a href="#//api/name/createSpriteFrame">&ndash;&nbsp;createSpriteFrame</a></code>
	</span>
	
	
</li>
						</ul>
						
						
						<a title="Image Methods" name="task_Image Methods"></a>
						<h3 class="subsubtitle task-title">Image Methods</h3>

						<ul class="task-list">
							<li>
	<span class="tooltip">
		<code><a href="#//api/name/initWithCGImage:contentScale:">&ndash;&nbsp;initWithCGImage:contentScale:</a></code>
	</span>
	
	
</li>
						</ul>
						
						
						<a title="PixelFormat Methods" name="task_PixelFormat Methods"></a>
						<h3 class="subsubtitle task-title">PixelFormat Methods</h3>

						<ul class="task-list">
							<li>
	<span class="tooltip">
		<code><a href="#//api/name/setDefaultAlphaPixelFormat:">+&nbsp;setDefaultAlphaPixelFormat:</a></code>
	</span>
	
	
</li><li>
	<span class="tooltip">
		<code><a href="#//api/name/defaultAlphaPixelFormat">+&nbsp;defaultAlphaPixelFormat</a></code>
	</span>
	
	
</li><li>
	<span class="tooltip">
		<code><a href="#//api/name/bitsPerPixelForFormat">&ndash;&nbsp;bitsPerPixelForFormat</a></code>
	</span>
	
	
</li><li>
	<span class="tooltip">
		<code><a href="#//api/name/stringForFormat">&ndash;&nbsp;stringForFormat</a></code>
	</span>
	
	
</li><li>
	<span class="tooltip">
		<code><a href="#//api/name/bitsPerPixelForFormat:">+&nbsp;bitsPerPixelForFormat:</a></code>
	</span>
	
	
</li>
						</ul>
						
					</div>
					
					
					
					
					
					<div class="section section-methods">
						<a title="Properties" name="properties"></a>
						<h2 class="subtitle subtitle-methods">Properties</h2>
						
						<div class="section-method">
	<a name="//api/name/antialiased" title="antialiased"></a>
	<h3 class="subsubtitle method-title">antialiased</h3>
	
	
	
	<div class="method-subsection brief-description">
		<p>True if antialised.</p>
	</div>		
	
    

	<div class="method-subsection method-declaration"><code>@property (nonatomic, assign, getter=isAntialiased) BOOL antialiased</code></div>

    
	
	
	
	
	
	
	
	
	
	
	
	
	
	<div class="method-subsection declared-in-section">
		<h4 class="method-subtitle">Declared In</h4>
		<code class="declared-in-ref">CCTexture.h</code><br />
	</div>				
	
	
</div>
						
						<div class="section-method">
	<a name="//api/name/contentScale" title="contentScale"></a>
	<h3 class="subsubtitle method-title">contentScale</h3>
	
	
	
	<div class="method-subsection brief-description">
		<p>Returns the contentScale of the texture.
In general &ldquo;HD&rdquo; textures return a contentScale of 2.0, while non-HD textures return 1.0.
Loading behavior is changed by [CCFileUtils set*ContentScaleFactor:].
The value can be changed manually if you want to force a certain content scale.</p>
	</div>		
	
    

	<div class="method-subsection method-declaration"><code>@property (nonatomic, readwrite) CGFloat contentScale</code></div>

    
	
	
	
	
	
	
	
	
	
	
	
	
	
	<div class="method-subsection declared-in-section">
		<h4 class="method-subtitle">Declared In</h4>
		<code class="declared-in-ref">CCTexture.h</code><br />
	</div>				
	
	
</div>
						
						<div class="section-method">
	<a name="//api/name/contentSizeInPixels" title="contentSizeInPixels"></a>
	<h3 class="subsubtitle method-title">contentSizeInPixels</h3>
	
	
	
	<div class="method-subsection brief-description">
		<p>Returns content size of the texture in pixels.</p>
	</div>		
	
    

	<div class="method-subsection method-declaration"><code>@property (nonatomic, readonly, nonatomic) CGSize contentSizeInPixels</code></div>

    
	
	
	
	
	
	
	
	
	
	
	
	
	
	<div class="method-subsection declared-in-section">
		<h4 class="method-subtitle">Declared In</h4>
		<code class="declared-in-ref">CCTexture.h</code><br />
	</div>				
	
	
</div>
						
						<div class="section-method">
	<a name="//api/name/pixelFormat" title="pixelFormat"></a>
	<h3 class="subsubtitle method-title">pixelFormat</h3>
	
	
	
	<div class="method-subsection brief-description">
		<p>Pixel format of the texture.</p>
	</div>		
	
    

	<div class="method-subsection method-declaration"><code>@property (nonatomic, readonly) CCTexturePixelFormat pixelFormat</code></div>

    
	
	
	
	
	
	
	
	
	
	
	
	
	
	<div class="method-subsection declared-in-section">
		<h4 class="method-subtitle">Declared In</h4>
		<code class="declared-in-ref">CCTexture.h</code><br />
	</div>				
	
	
</div>
						
						<div class="section-method">
	<a name="//api/name/pixelHeight" title="pixelHeight"></a>
	<h3 class="subsubtitle method-title">pixelHeight</h3>
	
	
	
	<div class="method-subsection brief-description">
		<p>Height in pixels.</p>
	</div>		
	
    

	<div class="method-subsection method-declaration"><code>@property (nonatomic, readonly) NSUInteger pixelHeight</code></div>

    
	
	
	
	
	
	
	
	
	
	
	
	
	
	<div class="method-subsection declared-in-section">
		<h4 class="method-subtitle">Declared In</h4>
		<code class="declared-in-ref">CCTexture.h</code><br />
	</div>				
	
	
</div>
						
						<div class="section-method">
	<a name="//api/name/pixelWidth" title="pixelWidth"></a>
	<h3 class="subsubtitle method-title">pixelWidth</h3>
	
	
	
	<div class="method-subsection brief-description">
		<p>Width in pixels.</p>
	</div>		
	
    

	<div class="method-subsection method-declaration"><code>@property (nonatomic, readonly) NSUInteger pixelWidth</code></div>

    
	
	
	
	
	
	
	
	
	
	
	
	
	
	<div class="method-subsection declared-in-section">
		<h4 class="method-subtitle">Declared In</h4>
		<code class="declared-in-ref">CCTexture.h</code><br />
	</div>				
	
	
</div>
						
						<div class="section-method">
	<a name="//api/name/premultipliedAlpha" title="premultipliedAlpha"></a>
	<h3 class="subsubtitle method-title">premultipliedAlpha</h3>
	
	
	
	<div class="method-subsection brief-description">
		<p>Whether or not the texture has their Alpha premultiplied.</p>
	</div>		
	
    

	<div class="method-subsection method-declaration"><code>@property (nonatomic, readonly, getter=hasPremultipliedAlpha) BOOL premultipliedAlpha</code></div>

    
	
	
	
	
	
	
	
	
	
	
	
	
	
	<div class="method-subsection declared-in-section">
		<h4 class="method-subtitle">Declared In</h4>
		<code class="declared-in-ref">CCTexture.h</code><br />
	</div>				
	
	
</div>
						
					</div>
					
					
					
					<div class="section section-methods">
						<a title="Class Methods" name="class_methods"></a>
						<h2 class="subtitle subtitle-methods">Class Methods</h2>
						
						<div class="section-method">
	<a name="//api/name/bitsPerPixelForFormat:" title="bitsPerPixelForFormat:"></a>
	<h3 class="subsubtitle method-title">bitsPerPixelForFormat:</h3>
	
	
	
	<div class="method-subsection brief-description">
		<p>Helper functions that returns bits per pixels for a given format.</p>
	</div>		
	
    

	<div class="method-subsection method-declaration"><code>+ (NSUInteger)bitsPerPixelForFormat:(CCTexturePixelFormat)<em>format</em></code></div>

    
	
	<div class="method-subsection arguments-section parameters">
		<h4 class="method-subtitle parameter-title">Parameters</h4>
		
		<dl class="argument-def parameter-def">
			<dt><em>format</em></dt>
			<dd><p>Format to query for pixelsize.</p></dd>
		</dl>
		
	</div>
	
	
	
	<div class="method-subsection return">
		<h4 class="method-subtitle parameter-title">Return Value</h4>
		<p>Number of bits for pixelformat.</p>
	</div>
	
	
	
	
	
	
	
	
	
	
	
	<div class="method-subsection declared-in-section">
		<h4 class="method-subtitle">Declared In</h4>
		<code class="declared-in-ref">CCTexture.h</code><br />
	</div>				
	
	
</div>
						
						<div class="section-method">
	<a name="//api/name/defaultAlphaPixelFormat" title="defaultAlphaPixelFormat"></a>
	<h3 class="subsubtitle method-title">defaultAlphaPixelFormat</h3>
	
	
	
	<div class="method-subsection brief-description">
		<p>Returns the alpha pixel format.</p>
	</div>		
	
    

	<div class="method-subsection method-declaration"><code>+ (CCTexturePixelFormat)defaultAlphaPixelFormat</code></div>

    
	
	
	
	<div class="method-subsection return">
		<h4 class="method-subtitle parameter-title">Return Value</h4>
		<p>The pixel format.</p>
	</div>
	
	
	
	
	
	
	
	
	
	
	
	<div class="method-subsection declared-in-section">
		<h4 class="method-subtitle">Declared In</h4>
		<code class="declared-in-ref">CCTexture.h</code><br />
	</div>				
	
	
</div>
						
						<div class="section-method">
	<a name="//api/name/none" title="none"></a>
	<h3 class="subsubtitle method-title">none</h3>
	
	
	
	<div class="method-subsection brief-description">
		<p>A placeholder value for a blank sizeless texture.</p>
	</div>		
	
    

	<div class="method-subsection method-declaration"><code>+ (instancetype)none</code></div>

    
	
	
	
	
	
	
	
	
	
	
	
	
	
	<div class="method-subsection declared-in-section">
		<h4 class="method-subtitle">Declared In</h4>
		<code class="declared-in-ref">CCTexture.h</code><br />
	</div>				
	
	
</div>
						
						<div class="section-method">
	<a name="//api/name/setDefaultAlphaPixelFormat:" title="setDefaultAlphaPixelFormat:"></a>
	<h3 class="subsubtitle method-title">setDefaultAlphaPixelFormat:</h3>
	
	
	
	<div class="method-subsection brief-description">
		<p>Sets the default pixel format for CGImages that contains alpha channel.</p>
	</div>		
	
    

	<div class="method-subsection method-declaration"><code>+ (void)setDefaultAlphaPixelFormat:(CCTexturePixelFormat)<em>format</em></code></div>

    
	
	<div class="method-subsection arguments-section parameters">
		<h4 class="method-subtitle parameter-title">Parameters</h4>
		
		<dl class="argument-def parameter-def">
			<dt><em>format</em></dt>
			<dd><p>Format to use with texture.</p></dd>
		</dl>
		
	</div>
	
	
	
	
	
	
	
	<div class="method-subsection discussion-section">
		<h4 class="method-subtitle">Discussion</h4>
		<p>How does it work ?
If the image is an RGBA (with Alpha) then the default pixel format will be used (it can be a 8-bit, 16-bit or 32-bit texture).
If the image is an RGB (without Alpha) then: If the default pixel format is RGBA8888 then a RGBA8888 (32-bit) will be used. Otherwise a RGB565 (16-bit texture) will be used.</p>

<p>This parameter is not valid for PVR / PVR.CCZ images.</p>
	</div>
	
	
	
	
	
	
	
	<div class="method-subsection declared-in-section">
		<h4 class="method-subtitle">Declared In</h4>
		<code class="declared-in-ref">CCTexture.h</code><br />
	</div>				
	
	
</div>
						
						<div class="section-method">
	<a name="//api/name/textureWithFile:" title="textureWithFile:"></a>
	<h3 class="subsubtitle method-title">textureWithFile:</h3>
	
	
	
	<div class="method-subsection brief-description">
		<p>Creates and returns a new texture, based on  the specified file path value.
If the texture has already been loaded, and resides in cache, the previously created texture is returned.</p>
	</div>		
	
    

	<div class="method-subsection method-declaration"><code>+ (instancetype)textureWithFile:(NSString *)<em>file</em></code></div>

    
	
	<div class="method-subsection arguments-section parameters">
		<h4 class="method-subtitle parameter-title">Parameters</h4>
		
		<dl class="argument-def parameter-def">
			<dt><em>file</em></dt>
			<dd><p>File path to load (should not include any suffixes).</p></dd>
		</dl>
		
	</div>
	
	
	
	<div class="method-subsection return">
		<h4 class="method-subtitle parameter-title">Return Value</h4>
		<p>The CCTexture object.</p>
	</div>
	
	
	
	
	
	
	
	
	
	
	
	<div class="method-subsection declared-in-section">
		<h4 class="method-subtitle">Declared In</h4>
		<code class="declared-in-ref">CCTexture.h</code><br />
	</div>				
	
	
</div>
						
					</div>
					
					
					
					<div class="section section-methods">
						<a title="Instance Methods" name="instance_methods"></a>
						<h2 class="subtitle subtitle-methods">Instance Methods</h2>
						
						<div class="section-method">
	<a name="//api/name/bitsPerPixelForFormat" title="bitsPerPixelForFormat"></a>
	<h3 class="subsubtitle method-title">bitsPerPixelForFormat</h3>
	
	
	
	<div class="method-subsection brief-description">
		<p>Returns the bits-per-pixel of the in-memory OpenGL texture.</p>
	</div>		
	
    

	<div class="method-subsection method-declaration"><code>- (NSUInteger)bitsPerPixelForFormat</code></div>

    
	
	
	
	<div class="method-subsection return">
		<h4 class="method-subtitle parameter-title">Return Value</h4>
		<p>Number of bits per pixel.</p>
	</div>
	
	
	
	
	
	
	
	
	
	
	
	<div class="method-subsection declared-in-section">
		<h4 class="method-subtitle">Declared In</h4>
		<code class="declared-in-ref">CCTexture.h</code><br />
	</div>				
	
	
</div>
						
						<div class="section-method">
	<a name="//api/name/contentSize" title="contentSize"></a>
	<h3 class="subsubtitle method-title">contentSize</h3>
	
	
	
	<div class="method-subsection brief-description">
		<p>Returns the content size of the texture in points.</p>
	</div>		
	
    

	<div class="method-subsection method-declaration"><code>- (CGSize)contentSize</code></div>

    
	
	
	
	
	
	
	
	
	
	
	
	
	
	<div class="method-subsection declared-in-section">
		<h4 class="method-subtitle">Declared In</h4>
		<code class="declared-in-ref">CCTexture.h</code><br />
	</div>				
	
	
</div>
						
						<div class="section-method">
	<a name="//api/name/createSpriteFrame" title="createSpriteFrame"></a>
	<h3 class="subsubtitle method-title">createSpriteFrame</h3>
	
	
	
	<div class="method-subsection brief-description">
		<p>Creates a sprite frame from the texture.</p>
	</div>		
	
    

	<div class="method-subsection method-declaration"><code>- (CCSpriteFrame *)createSpriteFrame</code></div>

    
	
	
	
	<div class="method-subsection return">
		<h4 class="method-subtitle parameter-title">Return Value</h4>
		<p>A new sprite frame.</p>
	</div>
	
	
	
	
	
	
	
	
	
	
	
	<div class="method-subsection declared-in-section">
		<h4 class="method-subtitle">Declared In</h4>
		<code class="declared-in-ref">CCTexture.h</code><br />
	</div>				
	
	
</div>
						
						<div class="section-method">
	<a name="//api/name/initWithCGImage:contentScale:" title="initWithCGImage:contentScale:"></a>
	<h3 class="subsubtitle method-title">initWithCGImage:contentScale:</h3>
	
	
	
	<div class="method-subsection brief-description">
		<p>Initializes and returns a texture from a CGImage object.</p>
	</div>		
	
    

	<div class="method-subsection method-declaration"><code>- (id)initWithCGImage:(CGImageRef)<em>cgImage</em> contentScale:(CGFloat)<em>contentScale</em></code></div>

    
	
	<div class="method-subsection arguments-section parameters">
		<h4 class="method-subtitle parameter-title">Parameters</h4>
		
		<dl class="argument-def parameter-def">
			<dt><em>cgImage</em></dt>
			<dd><p>CGImage to use for texture</p></dd>
		</dl>
		
		<dl class="argument-def parameter-def">
			<dt><em>contentScale</em></dt>
			<dd><p>Content scale.</p></dd>
		</dl>
		
	</div>
	
	
	
	<div class="method-subsection return">
		<h4 class="method-subtitle parameter-title">Return Value</h4>
		<p>An initialized CCTexture object.</p>
	</div>
	
	
	
	
	
	
	
	
	
	
	
	<div class="method-subsection declared-in-section">
		<h4 class="method-subtitle">Declared In</h4>
		<code class="declared-in-ref">CCTexture.h</code><br />
	</div>				
	
	
</div>
						
						<div class="section-method">
	<a name="//api/name/initWithData:pixelFormat:pixelsWide:pixelsHigh:contentSizeInPixels:contentScale:" title="initWithData:pixelFormat:pixelsWide:pixelsHigh:contentSizeInPixels:contentScale:"></a>
	<h3 class="subsubtitle method-title">initWithData:pixelFormat:pixelsWide:pixelsHigh:contentSizeInPixels:contentScale:</h3>
	
	
	
	<div class="method-subsection brief-description">
		<p>Initializes and returns a texture object using the specified data, <a href="#//api/name/pixelFormat">pixelFormat</a>, width, height, sizeInPixels and <a href="#//api/name/contentScale">contentScale</a> values.</p>
	</div>		
	
    

	<div class="method-subsection method-declaration"><code>- (id)initWithData:(const void *)<em>data</em> pixelFormat:(CCTexturePixelFormat)<em>pixelFormat</em> pixelsWide:(NSUInteger)<em>width</em> pixelsHigh:(NSUInteger)<em>height</em> contentSizeInPixels:(CGSize)<em>sizeInPixels</em> contentScale:(CGFloat)<em>contentScale</em></code></div>

    
	
	<div class="method-subsection arguments-section parameters">
		<h4 class="method-subtitle parameter-title">Parameters</h4>
		
		<dl class="argument-def parameter-def">
			<dt><em>data</em></dt>
			<dd><p>Pointer to a buffer containing the raw data.</p></dd>
		</dl>
		
		<dl class="argument-def parameter-def">
			<dt><em>pixelFormat</em></dt>
			<dd><p>Pixelformat of the data</p></dd>
		</dl>
		
		<dl class="argument-def parameter-def">
			<dt><em>width</em></dt>
			<dd><p>Width if the texture</p></dd>
		</dl>
		
		<dl class="argument-def parameter-def">
			<dt><em>height</em></dt>
			<dd><p>Height of the texture</p></dd>
		</dl>
		
		<dl class="argument-def parameter-def">
			<dt><em>sizeInPixels</em></dt>
			<dd><p>Size of resulting texture.</p></dd>
		</dl>
		
		<dl class="argument-def parameter-def">
			<dt><em>contentScale</em></dt>
			<dd><p>Content scale.</p></dd>
		</dl>
		
	</div>
	
	
	
	<div class="method-subsection return">
		<h4 class="method-subtitle parameter-title">Return Value</h4>
		<p>An initialized CCTexture Object.</p>
	</div>
	
	
	
	
	
	
	
	
	
	
	
	<div class="method-subsection declared-in-section">
		<h4 class="method-subtitle">Declared In</h4>
		<code class="declared-in-ref">CCTexture.h</code><br />
	</div>				
	
	
</div>
						
						<div class="section-method">
	<a name="//api/name/stringForFormat" title="stringForFormat"></a>
	<h3 class="subsubtitle method-title">stringForFormat</h3>
	
	
	
	<div class="method-subsection brief-description">
		<p>Returns the pixel format in a NSString.</p>
	</div>		
	
    

	<div class="method-subsection method-declaration"><code>- (NSString *)stringForFormat</code></div>

    
	
	
	
	
	
	
	
	
	
	
	
	
	
	<div class="method-subsection declared-in-section">
		<h4 class="method-subtitle">Declared In</h4>
		<code class="declared-in-ref">CCTexture.h</code><br />
	</div>				
	
	
</div>
						
					</div>
					
					
                    
                    
				</div>
				<div class="main-navigation navigation-bottom">
					<ul>
	<li><a href="../index.html">Index</a></li>
	<li><a href="../hierarchy.html">Hierarchy</a></li>
</ul>
				</div>
				<div id="footer">
					<hr />
					<div class="footer-copyright">
						<p><span class="copyright">&copy; 2014 3.2.0. All rights reserved. (Last updated: 2014-08-12)</span><br />
						
						<span class="generator">Generated by <a href="http://appledoc.gentlebytes.com">appledoc 2.2 (build 963)</a>.</span></p>
						
					</div>
				</div>
			</div>
		</article>
		<script type="text/javascript">
			function jumpToChange()
			{
				window.location.hash = this.options[this.selectedIndex].value;
			}
			
			function toggleTOC()
			{
				var contents = document.getElementById('contents');
				var tocContainer = document.getElementById('tocContainer');
				
				if (this.getAttribute('class') == 'open')
				{
					this.setAttribute('class', '');
					contents.setAttribute('class', '');
					tocContainer.setAttribute('class', '');
					
					window.name = "hideTOC";
				}
				else
				{
					this.setAttribute('class', 'open');
					contents.setAttribute('class', 'isShowingTOC');
					tocContainer.setAttribute('class', 'isShowingTOC');
					
					window.name = "";
				}
				return false;
			}
			
			function toggleTOCEntryChildren(e)
			{
				e.stopPropagation();
				var currentClass = this.getAttribute('class');
				if (currentClass == 'children') {
					this.setAttribute('class', 'children open');
				}
				else if (currentClass == 'children open') {
					this.setAttribute('class', 'children');
				}
				return false;
			}
			
			function tocEntryClick(e)
			{
				e.stopPropagation();
				return true;
			}
			
			function init()
			{
				var selectElement = document.getElementById('jumpTo');
				selectElement.addEventListener('change', jumpToChange, false);
				
				var tocButton = document.getElementById('table_of_contents');
				tocButton.addEventListener('click', toggleTOC, false);
				
				var taskTreeItem = document.getElementById('task_treeitem');
				if (taskTreeItem.getElementsByTagName('li').length > 0)
				{
					taskTreeItem.setAttribute('class', 'children');
					taskTreeItem.firstChild.setAttribute('class', 'disclosure');
				}
				
				var tocList = document.getElementById('toc');
				
				var tocEntries = tocList.getElementsByTagName('li');
				for (var i = 0; i < tocEntries.length; i++) {
					tocEntries[i].addEventListener('click', toggleTOCEntryChildren, false);
				}
				
				var tocLinks = tocList.getElementsByTagName('a');
				for (var i = 0; i < tocLinks.length; i++) {
					tocLinks[i].addEventListener('click', tocEntryClick, false);
				}
				
				if (window.name == "hideTOC") {
					toggleTOC.call(tocButton);
				}
			}
			
			window.onload = init;
			
			// If showing in Xcode, hide the TOC and Header
			if (navigator.userAgent.match(/xcode/i)) {
				document.getElementById("contents").className = "hideInXcode"
				document.getElementById("tocContainer").className = "hideInXcode"
				document.getElementById("top_header").className = "hideInXcode"
			}
			
		</script>
	</body>
</html>